package manager
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	import mx.collections.ArrayCollection;
	
	[Event(name="testQuery", type="flash.events.Event")]
	public class ApplicationModel extends EventDispatcher
	{
		private static var _instance:ApplicationModel;
		private var _testAc:ArrayCollection;
		
		public const TEST_QUERY:String = "testQuery";
		
		public function ApplicationModel()
		{
			if(_instance != null){ 
				throw new Error("Error: Singletons can only be instantiated via getInstance() method!");
			} 
		}
		
		public static function getInstance():ApplicationModel{
			if(_instance == null)_instance = new ApplicationModel();
			
			return _instance;
		}
		
		public function get testAc():ArrayCollection
		{
			return _testAc;
		}
		
		public function set testAc(arr:ArrayCollection):void
		{
			_testAc = arr;
			dispatchEvent(new Event(TEST_QUERY));
		}
	}
}